/*=====================================================
Critical Links
Auto Configuration Server

Authors:
	Rui Eduardo Gouveia Gil - r-gil@critical-links.com

Date: 2010
Version 0.1
=======================================================*/
#include "httpd/HttpAuthentication.h"
#include "httpd/HttpUserManager.h"
#include "ACSConfig.h"

namespace acs
{

HttpAuthentication::HttpAuthentication() : pion::net::HTTPCookieAuth(pion::net::PionUserManagerPtr(HttpUserManager::getInstance()))
{
	this->addPermit("/js/prototype.js");
	this->addPermit("/ACSInterface");
	this->addPermit("/login.html");
	this->addPermit("/images/");
	this->addPermit("/css/");

	this->addRestrict("");

	this->setOption("redirect","/login.html");
}

HttpAuthentication::~HttpAuthentication()
{

}

bool HttpAuthentication::handleRequest (pion::net::HTTPRequestPtr &request, pion::net::TCPConnectionPtr &tcp_conn)
{
	bool result = pion::net::HTTPCookieAuth::handleRequest(request,tcp_conn);

	return result;
}

}
